// ABC414  B.cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string S = "";
  int sum = 0;
  for (int i = 1; i <= n; i++) {
    char c;
    int l;
    cin >> c >> l;
    sum += l;
    if (sum > 100) {
      cout << "Too Long";
      return 0;
    }
    while (l--) {
      S += c;
    }
  }
  cout << S;
  return 0;
}